1. Field of the Invention
The present invention relates to a data processor, and more particularly to a data processor which performs in a unified manner the exception processing of interrupt process and the trap instruction of internal interrupt instruction.
2. Description of the Prior Art
In the conventional data processor provided with an EIT process, a mechanism, such as an interrupt process mechanism, an exception process mechanism and an internal interrupt instruction process mechanism, when an EIT process request occurs is accepted to start the EIT process. After the information showing the internal state is saved to an external memory, an internal register value is automatically reloaded onto a value of an internal state variable previously determined as a function of the data processor, thereby performing the processing. A flow chart of the conventional EIT process starting method is shown in FIG. 1. Upon accepting an EIT process request at a step 1007 in FIG. 1, at a step 1008 an address of the external memory in the data processor in which the head address of an EIT process handler is stored is generated, and at a step 1009 a program status word (to be hereinafter referred to as PSW), which reads the head address of the EIT process handler and stores data showing the internal state of the data processor, is updated into a predetermined value for the EIT process in the data processor. For example, when the external interrupt is accepted, the variable showing the acceptance priority level of external interrupt in the PSW is automatically reloaded for the purpose of inhibiting the acceptance of external interrupt with higher priority level than that of the accepted external interrupt until the EIT process ends. Next, at a step 1010 in FIG. 1, the internal state of the data processor is saved to the stack, and thereafter at a step 1011 the EIT process handler previously programmed with respect to the content of the EIT is started.
Such method, however, uniquely decides the internal state of the data processor when the EIT process handler starts, so that a programmer is largely restricted. Especially it is complicated for him to set the state of the data processor where a multiple EIT process is carried out. In other words, as above-mentioned, the EIT process handler has hitherto started only under the internal state predetermined by the data processor, which has been one restriction on programming for the programmer. Also, the programmer had to fully recognize the internal state of the data processor when the EIT process handler starts, and sometimes needed to change by himself the internal state variable, whereby the processing has been troublesome.